<template>
  <e-table
    ref="eTable"
    @tableCheck="handleTableCheck"
    @getList="handleGetList"
    :tableData="tableData"
    :columns="columns"
    :loading="loading"
    :total="total"
  ></e-table>
</template>

<script>
export default {
  data() {
    return {
      tableData: [],
      total: 1,
      loading: false,
      columns: [
        {
          label: '党支部名称',
          prop: ''
        },
        {
          label: '科室',
          prop: ''
        },
        {
          label: '党支部编码',
          prop: ''
        }
      ],
      queryParam: {
        pageNo: 1,
        pageSize: 10
      }
    }
  },
  methods: {
    async handleGetList(param = {}) {
      this.loading = true
      this.queryParam = Object.assign(this.queryParam, param)
      const res = await checkList(this.queryParam)

      if (res && res.data.records.length > 0) {
        const {
          state,
          data: { records, total }
        } = res
        this.tableData = records
        this.total = total
      } else {
        this.tableData = []
        this.total = 1
      }
      this.loading = false
    }
  }
}
</script>
